package com.automannn.security.sso.server;

import com.automannn.boot.core.web.annotations.NoopHttpReturnValueEnhance;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import tk.mybatis.spring.annotation.MapperScan;

/**
 * @author chenkh
 * @time 2021/3/7 13:42
 */
@SpringBootApplication(scanBasePackages = {"com.automannn.boot","com.automannn.security"})
@MapperScan(basePackages = {"com.automannn.boot.**.dao"})
@Controller
@EnableWebSecurity(debug = true)
public class SsoServerApplication {
    @GetMapping("/api/user")
    @ResponseBody
    @NoopHttpReturnValueEnhance
    public Authentication user(Authentication user){
        return user;
    }
    public static void main(String[] args) {
        SpringApplication.run(SsoServerApplication.class);
    }

}
